home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
GRAPHICS
/
IMAGE165.SPK
/
!Image
/
Docs
/
P4
< prev
next >
Wrap
Text File
|
1996-11-02
|
10KB
|
242 lines
Loading and Saving
------------------
Image can load and save various file formats :
Sprite - 1, 2, 4, 8, 16 and 32 bpp (not CMYK)
Clear files
JPEG files
PBMPlus - PPM and PGM only, not PBM (only saves P6, raw full colour)
GIF files - Memory Permitting
Image Files - Image's own full information file format
TIFF - Various compression schemes supported
BMP - 4, 8 and 24 bpp, uncompressed, save only
Targa - save only
It can also request ChangeFSI to convert pictures for it, thus it can load
many different picture formats. See below for details.
Where files contain more than one picture, the first picture is
loaded.
To load a picture simply drag the file to any of Image's windows -
Image will then attempt to load the picture into its current input
image bank (see 'Image Banks').
To save an image simply click MENU over the Image Display Window. This
brings up a save window which contains the usual icons, plus icons to
select the output format :
Sprite - Saves the current display sprite (the sprite used
to display in the display window). This will be
an old style sprite of 1, 2, 4 or 8 bpp or a new
style 16 or 32 bpp sprite (depending
on the options set in the configuration window)
(See 'Configuration').
Sprite 32k - This saves the image as an old style 16 bpp sprite
(as used by Computer Concepts' Colour Cards)
This option is only available where appropriate.
16 bpp - Saves a new style 16 bpp sprite. (actually 15 bpp)
32 bpp - Saves a new style 32 bpp sprite. (actually 24 bpp)
Clear - Saves a clear file.
JPEG - Saves a JPEG file (see below)
Image - Saves an Image file (see below)
TIFF none - TIFF with no compression
TIFF LZW - TIFF with LZW compression
TIFF packbits - TIFF with packbits compression
BMP 4/8bit - Windows BMP format (4 or 8 bpp)
BMP 24bit - Windows BMP format (24bpp)
GIF - CompuServe GIF format
Targa - TrueVision Targa format
In all but the 'Sprite' and BMP options the image saved is that which resides
in the current input image bank.
Apart from the 'Image' file format, the masking information is generally lost
when saving a picture, except when saving 'Sprite' and the mask option in the
configuration window is set - or when saving '32 bpp' when the masking
information will be preserved as far as Image is concerned (other
applications will ignore this information).
In order to maintain full information (full colour information and
full masking information) you should save as an Image file or a 32 bpp
sprite. Note, however, many current (Risc OS 3.1) applications will not be
able to read this sprite.
Sprite Palettes
---------------
When loading a sprite, Image can (if requested) load the palette (if
available) which goes with the palette into a special 'User Palette' which
can be used for the display sprite (see 'Configuration').
The palette will automatically be loaded if the auto loading option is set in
the configuration window - you can override this by holding down SHIFT when
loading the file.
Alternatively, you can force the palette to be loaded into the user palette
by holding down CTRL when loading the sprite.
When saving a sprite the palette associated with it (either user palette or a
grey scale palette) will be saved with the sprite.
The 'Image' file format
-----------------------
The Image file format is a special format designed for saving the pictures
from image with full information (including masking information) with the
added bonus of compression.
The Image format uses special compression routines which produce compression
rates similar, and often better, than similar lossless compression systems.
Compression is generally between 20% and 90%, with an average of
approximately 68% (in tests using a range of pictures) reduction in file size
over a 32bpp sprite (compare with a reduction of 62% for TIFF using LZW
compression).
For photo realistic pictures compression averages at a reduction of 46%
(compared with 40% for TIFF).
Saving JPEG files
-----------------
Next to the JPEG option is a writable icon for specifying what 'quality'
value to pass to the JPEG compressor.
The quality value lets you trade off compressed file size against quality of
the reconstructed image: the higher the quality setting, the larger the JPEG
file, and the closer the output image will be to the original input.
Normally you want to use the lowest quality setting (smallest file) that
decompresses into something visually indistinguishable from the original
image. For this purpose the quality setting should be between 50 and 95; the
default of 75 is often about right. If you see defects at a quality of 75,
then go up 5 or 10 counts at a time until you are happy with the output
image. (The optimal setting will vary from one image to another.)
A quality of 100 will generate a quantization table of all 1's, eliminating
loss in the quantization step (but there is still information loss in
subsampling, as well as roundoff error). This setting is mainly of interest
for experimental purposes. Quality values above about 95 are NOT recommended
for normal use; the compressed file size goes up dramatically for hardly any
gain in output image quality.
In the other direction, quality values below 50 will produce very small files
of low image quality. Settings around 5 to 10 might be useful in preparing an
index of a large image library, for example.
BMP Files
---------
Image can save Microsoft Windows BMP files with 4 and 8 bits per pixel. This
option, like 'Sprite', saves a copy of the current display sprite rather than
the current input image bank. For this reason the display sprite must be in
the correct format for the saved file.
To produce a 4 bpp (16 colour) BMP file the display sprite must be a 16
colour sprite - similarly for an 8 bpp (256 colour) BMP the display sprite
must be a 256 colour sprite.
The reason that the display sprite is used is to allow BMP files to be saved
using Floyd-Steinberg error diffusion.
Loading BMP files is supported by Image through ChangeFSI.
24bpp BMP production is also available, and this (as with most save options)
uses the current input image bank as the source.
GIF Files
---------
There are three GIF save options:
Gif 24->8
---------
This option converts the 24bpp image in the current input bank to an 8bpp
GIF file with an optimal palette generated from the image.
GIF 8bit
--------
This option only works if the current display sprite is 8bpp (256 colour).
It generates a GIF file from the current display sprite and the current
display palette.
NOTE: if the current display sprite has a mask then the GIF file produced
will contain a mask, using the last colour in the display palette as the mask
colour. Thus to ensure this colour is not used by a dithering operation
it must match another colour in the palette exactly. The palette supplied
called 'GIF255' is a version of the standard Risc OS palette which can be
used for GIF production with mask.
GIF 8bit int
------------
This option is similar to the GIF 8bit option, except it produced an
interlaced GIF file.
Squashed Files
--------------
Image can load files which have been compressed using Acorn's !Squash
application. In order to be able to load these files, however, Acorn's
'squash' utility needs to be in the path. To ensure this you need to
copy the utility (located in the !Squash application) in the Library
directory (on a Risc PC this is located inside the !Boot application).
ChangeFSI loading
-----------------
If you have a copy of ChangeFSI you can get Image to use it for loading file
formats that Image can't handle itself.
In fact if 'ChangeFSI' has been 'seen' by the filer then you need do nothing
to use this facility, any file dragged to Image that Image can't handle
itself will be passed to ChangeFSI to convert, and then Image will load the
converted version.
You can also 'teach' Image about the location of 'ChangeFSI' so that it is
not necessary to make sure that the filer has 'seen' it. To do this simply
drag the '!ChangeFSI' application to any of Image's windows, then using the
configuration window save your configuration, and the location of ChangeFSI
will be saved as part of that configuration.
The configuration window contains an icon which shows the current location
known for ChangeFSI and also an option icon marked 'New'. This option is used
to tell Image whether the version of ChangeFSI you have is new sprite aware.
If it is (ChangeFSI version 0.95 or later) then this option will cause
ChangeFSI to use a 32 bpp sprite for transfer, otherwise a PPM file is used.
If in doubt as to which version of ChangeFSI you have, you should not select
this option. The advantage of setting this option is that loading will be
faster.
ChangeFSI is supplied with RISC OS 3.1 on the RISC OS 3 support disc.
Acknowledgements
----------------
JPEG loading and saving are handled by software from the 'Independent JPEG
Group's JPEG software' which has been altered to provide support for Image's
own use.
TIFF Loading/Saving uses libtiff:
* Copyright (c) 1988, 1989, 1990, 1991 Sam Leffler
* Copyright (c) 1991 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.